'''
Created on Oct 11, 2009

@author: jaimeblasco
'''
from django.db import models

class Domain(models.Model):
    name = models.CharField(max_length=100,primary_key=True)
    createDate = models.DateTimeField('Create Date',null=True)
    active = models.BooleanField()
    count = models.IntegerField()
    
    def __unicode__(self):
        return self.name

class Node(models.Model):
    ip = models.IPAddressField(primary_key=True)
    domain = models.ManyToManyField(Domain, null=True)
    latitude = models.CharField(max_length=100, null=True)
    longitude = models.CharField(max_length=100, null=True)
    countryName = models.CharField(max_length=20, null=True)
    countryCode = models.CharField(max_length=5, null=True)
    city = models.CharField(max_length=20, null=True)
    
    def __unicode__(self):
        return self.ip
